package phonebook;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        PhoneBook myPhoneBook = new PhoneBook();
        myPhoneBook.addContact("张三", "1234567890");
        myPhoneBook.addContact("李四", "0987654321");

        // 创建一个Scanner对象，用于从控制台接收输入
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入要查询的联系人姓名:");
        String name = scanner.nextLine();

        // 根据输入的姓名查询电话号码，并打印结果
        String phoneNumber = myPhoneBook.getPhoneNumber(name);
        System.out.println(name + "的电话号码是：" + phoneNumber);

        scanner.close();

    }
}
